/**********************************************

Table B.29 -- DID Regressions: Impact of bans
on ratio of cousin marriage types

**********************************************/

set segmentsize 3g
set more off
clear all


* Load marriage level data on FCM Types (Familinx)
use "$dir/Data/Original/FCM_Familinx.dta", clear

* Collapse at the state-year-level
collapse (sum) cm_fbd cm_fsd cm_mbd cm_msd match_any matching_first (firstnm) post_ban (rawsum) id_geni, by(state year)

keep if year >= 1750 & year <= 1940

foreach var of varlist(cm_fsd-cm_msd){
gen ratio_`var' = cm_fbd/`var'
replace ratio_`var' = 0 if ratio_`var' == .
}


gen ratio_cm = cm_fbd/(cm_fsd + cm_msd + cm_mbd) /* fbd relative to all other marriages */
replace ratio_cm = 0 if ratio_cm == .


* Regressions
eststo clear
foreach var of varlist(ratio_cm ratio_cm_fsd ratio_cm_mbd ratio_cm_msd){
eststo: reghdfe `var' post_ban, absorb(state year) cluster(state)
}

esttab using "$dir/Output/TablesFigures/fs_cmtypes.tex", keep(post_ban) se ar2 starlevels(* 0.10 ** 0.05 *** 0.010) replace


